﻿ <!--#include file="inc/common.asp" -->

 <%
    if userDB<>blogDB and not isEmpty(registerUrl) and registerUrl<>"" then
        call closeDB()
        response.redirect registerUrl
    end if

    if request("actionType")="register" then
        dim user_name 
        user_name = trim(filterHTML(request("user_name")))
        dim tmpUserObj
        set tmpUserObj = new UserClass
        if user_name="" then
            message("用户名不能为空")
        else
            tmpUserObj.load(user_name)
            if tmpUserObj.isFound then           
                message(user_name & "已经被其他用户注册")
            end if
            
            if len(user_name) <> strLen(user_name) then
                message("注册用户名只能使用英文字符、数字和下划线组成")
            end if

            Session(GLOBAL_CACHE_PREFIX & "userName")=user_Name
        end if

        dim password_new 
        password_new =  filterHTML(request("userpassword"))
        if trim(password_new)<>"" then
            if password_new<>filterHTML(request("password2")) then
                message("两次输入的密码不匹配")
            else    
                password_new=md5(password_new)
                if SUPPORT_MD5_16BITS and userDB<>blogDB and len(password_new)=32 then
                    password_new = mid(password_new,9,16)
                end if
                Session(GLOBAL_CACHE_PREFIX & "password")=password_new
            end if
        else
            message("密码不能为空")
        end if    

        tmpUserObj.userName=user_name
        tmpUserObj.password = password_new
        tmpUserObj.faceUrl= filterHTML(request("face_url"))
        tmpUserObj.email= filterHTML(request("useremail"))
        tmpUserObj.webUrl= filterHTML(request("homepage"))
        tmpUserObj.msn= filterHTML(request("MSN"))
        tmpUserObj.qq= filterHTML(request("OICQ"))
        tmpUserObj.sign= filterHTML(request("sign"))
        tmpUserObj.store()

        call closeDB
        dim succ_msg
        succ_msg = "用户" & user_name & "注册成功"
        if USER_REGISTER_BLOG = true then
        	succ_msg = succ_msg & "，继续<a href=reg_blog.asp>申请Blog</a>！"
    	end if
        message(succ_msg)
        response.end
    end if
 %>
 <HTML><HEAD><TITLE><%=blogObj.blogTitle%></TITLE>
<META http-equiv=Content-Type content="text/html; charset=<%=DEFAULT_CHARSET%>">

<style type="text/css">
TD{
    font-size:x-small;
    color:#333333;letter-spacing : 1pt ;line-height :14pt
}

INPUT {
	BORDER-RIGHT: #98ccd0 1px dotted; BORDER-TOP: #98ccd0 1px dotted; FONT-SIZE: x-small; BORDER-LEFT: #98ccd0 1px dotted; COLOR: #666666; BORDER-BOTTOM: #98ccd0 1px dotted; FONT-FAMILY: "Verdana"; BACKGROUND-COLOR: transparent
}
SELECT {
	BORDER-RIGHT: #98ccd0 1px dotted; BORDER-TOP: #98ccd0 1px dotted; FONT-SIZE: x-small; BORDER-LEFT: #98ccd0 1px dotted; COLOR: #666666; BORDER-BOTTOM: #98ccd0 1px dotted; FONT-FAMILY: "Verdana"; BACKGROUND-COLOR: transparent
}
TEXTAREA {
	BORDER-RIGHT: #98ccd0 1px dotted; BORDER-TOP: #98ccd0 1px dotted; FONT-SIZE: x-small; BORDER-LEFT: #98ccd0 1px dotted; COLOR: #666666; BORDER-BOTTOM: #98ccd0 1px dotted; FONT-FAMILY: "Verdana"; BACKGROUND-COLOR: transparent
}
BUTTON {
	BORDER-RIGHT: #98ccd0 1px dotted; BORDER-TOP: #98ccd0 1px dotted; FONT-SIZE: x-small; BORDER-LEFT: #98ccd0 1px dotted; COLOR: #666666; BORDER-BOTTOM: #98ccd0 1px solid; FONT-FAMILY: "Verdana"; BACKGROUND-COLOR: transparent
}

</style>
<script language=javascript>
function selectFace(){
    window.open("select_face.asp","select_fase","width=300px,height=400px,resizable,scrollbars");
}
</script>
</HEAD>
<BODY bgProperties=fixed topMargin=2 bgcolor=white onload="">
   <br><br>
   <form name=form1 action=register.asp method=post>   
        <table width=450px border=1 cellspacing=0 cellpadding=4 bordercolordark=#FFFFFF bordercolorlight=#98ccd0  bordercolor=#98ccd0 align=center >
          <tr  bgcolor=#98ccd0 >
            <td align=center nowrap height=40px  colspan=2>-->> .::.::: <b>用户注册</b>  :::.::. <<-- </td>       
          </tr>
          <tr> 
           <td nowrap>
           用户名：
            </td>   
           <td>
           <input type=input name=user_name size=15 value="" > <font color=red>*</font>
            </td>   
          </tr>                                                                                 
          <tr> 
           <td nowrap>
           密码：
            </td>   
           <td>
           <input type=password name=userpassword size=15 > <font color=red>*</font>
            </td>   
          </tr>                                                                                 
          <tr> 
           <td nowrap>
           再次输入密码：
            </td>   
           <td>
           <input type=password name=password2 size=15 > <font color=red>*</font>
            </td>   
          </tr>                                                                                 
          <tr> 
           <td nowrap >
           头像：
            </td>   
           <td >
               <input type=text name=face_url size=25 value="<%=userObj.faceUrl%>" onblur="document.getElementById('face_img').src=this.value" > 
               <input type=button value="选择" onclick="selectFace()">
               <img id=face_img align=center border=0 src="<%=userObj.faceUrl%>">
           </td>   
          </tr>                                                                                 
          <tr> 
           <td nowrap>
           电子邮件：
            </td>   
           <td>
           <input type=text name=useremail size=30 value=""> 
            </td>   
          </tr>                                                                                 
          <tr> 
           <td nowrap>
           个人主页：
            </td>   
           <td>
           <input type=text name=homepage size=30 value=""> 
            </td>   
          </tr>                                                                                 
          <tr> 
           <td nowrap>
           MSN 帐号：
            </td>   
           <td>
           <input type=text name=MSN size=30 value=""> 
            </td>   
          </tr>                                                                                 
          <tr> 
           <td nowrap>
           QQ  号码：
            </td>   
           <td>
           <input type=text name=OICQ size=30 value=""> 
            </td>   
          </tr>                                                                                 
          <tr> 
           <td nowrap>
           签名：<br><i>不能超过 300 个字符 </i>
            </td>   
           <td>
           <textarea name=sign cols=40 rows=4></textarea> 
            </td>   
          </tr>                                                                                 
          <tr  bgcolor=#98ccd0 > 
           <td colspan=2>
            &nbsp;
            </td>   
          </tr>                                                                                 
          <tr>                                                                              
            <td align=center height=40px colspan=2  >  
               <input type=button value=' 注册 ' onclick="form1.submit()"> 
               <input type=button onclick='history.back()' value=' 后退 '> 
               <input type=button onclick='document.location="index.asp?blog_id=<%=blogObj.blogId%>&cat_id=<%=blogCatObj.catId%>&pageno=<%=request("pageno")%>"' value=' 返回 '> 
            </td>
          </tr>
        </table>

        <input type=hidden name=blog_id value=<%=blogObj.blogId%> >
        <input type=hidden name=cat_id value=<%=blogCatObj.catId%> >
        <input type=hidden name=pageno value=<%=request("pageno")%> >


        <input type=hidden name=actionType value="register" >
    </form>
</BODY>


</HTML>

<!--#include file="inc/end.asp" -->